import React from "react";
import { HashRouter, Routes, Route, Navigate } from "react-router-dom";
import { GlobalProvider } from "./context/GlobalContext";
import LoginPage from "./pages/login";
import { RegisterPage } from "./pages/register";
import { ChatPage } from "./pages/chat";
import { SettingsPage } from "./pages/settings";
import { FeedbackPage } from "./pages/feedback";
import { AboutPage } from "./pages/about";
import { CreationPage } from "./pages/creation"; // 添加新导入
import "./styles/auth.css";

function App() {
  return (
    <GlobalProvider>
      <HashRouter>
        <Routes>
          <Route path="/login" element={<LoginPage />} />
          <Route path="/register" element={<RegisterPage />} />
          <Route path="/chat" element={<ChatPage />} />
          <Route path="/settings" element={<SettingsPage />} />
          <Route path="/" element={<Navigate to="/chat" replace />} />
          <Route path="/feedback" element={<FeedbackPage />} />
          <Route path="/about" element={<AboutPage />} />
          <Route path="/creation" element={<CreationPage />} /> {/* 添加新路由 */}
        </Routes>
      </HashRouter>
    </GlobalProvider>
  );
}

export default App;
